package cn.com.pagoda.ideplugin.service.pwdGen.service.impl;

import cn.com.pagoda.ideplugin.service.pwdGen.service.PasswordGenerator;

import java.util.Random;

/**
 * 数字
 * @author Mch
 * @date 2023-05-27
 */
public class NumericPasswordGenerator implements PasswordGenerator {
    @Override
    public String generatePassword(int length) {
        StringBuilder password = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            password.append(random.nextInt(10)); // 生成随机数字
        }
        return password.toString();
    }
}